/*
 Navicat Premium Data Transfer

 Source Server         : 101.33.236.46
 Source Server Type    : MySQL
 Source Server Version : 80027
 Source Host           : 101.33.236.46:3318
 Source Schema         : demo

 Target Server Type    : MySQL
 Target Server Version : 80027
 File Encoding         : 65001

 Date: 19/12/2023 15:01:13
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for boyfriend
-- ----------------------------
DROP TABLE IF EXISTS `boyfriend`;
CREATE TABLE `boyfriend` (
  `boyfriend_id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(15) DEFAULT NULL COMMENT '男朋友名字',
  `age` int DEFAULT NULL COMMENT '年龄',
  PRIMARY KEY (`boyfriend_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='男朋友有表';

-- ----------------------------
-- Records of boyfriend
-- ----------------------------
BEGIN;
INSERT INTO `boyfriend` (`boyfriend_id`, `name`, `age`) VALUES (1, '张无忌', 28);
INSERT INTO `boyfriend` (`boyfriend_id`, `name`, `age`) VALUES (2, '宋青书', 30);
COMMIT;

-- ----------------------------
-- Table structure for boyfriend_girlfriend
-- ----------------------------
DROP TABLE IF EXISTS `boyfriend_girlfriend`;
CREATE TABLE `boyfriend_girlfriend` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `boyfriend_id` bigint DEFAULT NULL COMMENT '注意这是boyfriend表中的主键id',
  `girlfriend_id` bigint DEFAULT NULL COMMENT '注意这是girlfriend表中的主键id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='这是一张中间表,男朋友和女朋友关联中间表';

-- ----------------------------
-- Records of boyfriend_girlfriend
-- ----------------------------
BEGIN;
INSERT INTO `boyfriend_girlfriend` (`id`, `boyfriend_id`, `girlfriend_id`) VALUES (1, 1, 1);
INSERT INTO `boyfriend_girlfriend` (`id`, `boyfriend_id`, `girlfriend_id`) VALUES (2, 1, 2);
INSERT INTO `boyfriend_girlfriend` (`id`, `boyfriend_id`, `girlfriend_id`) VALUES (3, 1, 4);
INSERT INTO `boyfriend_girlfriend` (`id`, `boyfriend_id`, `girlfriend_id`) VALUES (4, 1, 3);
INSERT INTO `boyfriend_girlfriend` (`id`, `boyfriend_id`, `girlfriend_id`) VALUES (5, 2, 3);
COMMIT;

-- ----------------------------
-- Table structure for girlfriend
-- ----------------------------
DROP TABLE IF EXISTS `girlfriend`;
CREATE TABLE `girlfriend` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(15) DEFAULT NULL COMMENT '女朋友名字',
  `age` int DEFAULT NULL COMMENT '年龄',
  `girlfriend_id` bigint unsigned DEFAULT NULL COMMENT '关联男朋友表',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='女朋友有表';

-- ----------------------------
-- Records of girlfriend
-- ----------------------------
BEGIN;
INSERT INTO `girlfriend` (`id`, `name`, `age`, `girlfriend_id`) VALUES (1, '小昭', 25, 1);
INSERT INTO `girlfriend` (`id`, `name`, `age`, `girlfriend_id`) VALUES (2, '赵敏', 23, 1);
INSERT INTO `girlfriend` (`id`, `name`, `age`, `girlfriend_id`) VALUES (3, '周芷若', 23, 2);
INSERT INTO `girlfriend` (`id`, `name`, `age`, `girlfriend_id`) VALUES (4, '珠儿', 20, 1);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
